<?php
defined('SYSPATH') or die('No direct script access.') ;
/**
 * @author clooney
 *  2011/11/4
 */
class Cli_Cleartaobaolink extends CLI
{


	public function main()
	{

		self::clean_description();
	}



	/**
	 * 清理商品描述外部链接
	 *
	 * @param	none
	 * @return	void
	 * @update	2011/10/31
	 */
	public static function clean_description()
	{
		$goods = DB::select('module_id', 'module_config')
			->from('shop_module_config')
			->where('module_type', '=', 'Custom')
			->fetch_all();
		foreach ($goods as $g)
		{
		    $content = unserialize($g['module_config']);
			$description = Items::clearurl($content);
			$description = serialize($description);
			DB::update('shop_module_config')
				->set(array('module_config' => $description))
				->where('module_id', '=', $g['module_id'])
				->execute();
				CLI::output($g['module_id']."\n");
		}
		
		echo  'I  have  done thanks';exit;
	}

	
}